//#include <lifeconfig.h>
#include <appli_core.hpp>
#include <navierstokes.hpp>

#include <string>
/**
 * This routine returns the list of options using the
 * boost::program_options library. The data returned is typically used
 * as an argument of a Life::Application subclass.
 *
 * \return the list of options
 */
inline
Life::po::options_description
makeOptions()
{
  Life::po::options_description stokesoptions("Stokes options");
  stokesoptions.add_options()
    //        ("penalS", Life::po::value<double>()->default_value( 0.5 ), "penalisation speed parameter")
    //        ("penalP", Life::po::value<double>()->default_value( 0.5 ), "penalisation presure parameter")
    ("entree-v", Life::po::value<double>()->default_value( 1.0 ), "vitesse d entree")
    ("sortie-v", Life::po::value<double>()->default_value( 1.0 ), "vitesse de sortie")
    ("sortie-p", Life::po::value<double>()->default_value( 0.0 ), "pression imposee sur la sortie")
    ("entree-p", Life::po::value<double>()->default_value( 0.0 ), "pression imposee sur l'entree")
    ("rho", Life::po::value<double>()->default_value( 1.0 ), "masse volumique")
    ("mu", Life::po::value<double>()->default_value( 1.0 ), "reaction coefficient component")
    ("hsize", Life::po::value<double>()->default_value( 0.5 ), "first h value to start convergence")
    ("bccoeff", Life::po::value<double>()->default_value( 10.0 ), "coeff for weak Dirichlet conditions")
    ("f0", Life::po::value<double>()->default_value( 0.0 ), "f0")
    ("stab", Life::po::value<int>()->default_value( 0 ), "0 = Non, 1 = oui")
    ("stat", Life::po::value<int>()->default_value( 0 ), "0 = Non, 1 = oui")
    ("coef-err", Life::po::value<double>()->default_value( 1e-5 ), "Coeferr")
    ("mesh", Life::po::value<std::string>()->default_value( "ola" ), "0 = stationnaire, 1 = instationnaire")
    ("dt", Life::po::value<double>()->default_value( 0.1 ), "dt")
    ("Tfinal", Life::po::value<double>()->default_value( 1.0 ), "Temps final")
    ("export", "export results(ensight, data file(1D)")
    ("export-matlab", "export matrix and vectors in matlab" )
    ;
  return stokesoptions.add( Life::life_options() ) ;
}


/**
 * This routine defines some information about the application like
 * authors, version, or name of the application. The data returned is
 * typically used as an argument of a Life::Application subclass.
 *
 * \return some data about the application.
 */
inline
Life::AboutData
makeAbout()
{
  Life::AboutData about( "MonStokes" ,
			 "monstokes" ,
			 "0.1",
			 "Stokes equation on simplices or simplex products",
			 Life::AboutData::License_GPL,
			 "Copyright (c) 2009 Universite de Grenoble 1 (Joseph Fourier)");

  about.addAuthor("Vincent Chabannes", "developer", "vincent.chabannes@imag.fr", "");
  return about;

}


int
main( int argc, char** argv )
{

  using namespace Life;
  /* assertions handling */
  Life::Assert::setLog( "stokes.assert");

  /* change parameters below */
  const int nDim = 2;
  const int nOrder = 2;

  typedef Life::NavierStokes<nDim, nOrder, Simplex> NavierStokes_type;

#if 0
  /* define and run application */
  NavierStokes_type NavierStokes( argc, argv, makeAbout(), makeOptions() );
  //NavierStokes.run();
  NavierStokes.runPtFixe();
#endif

  Core_Ns_ALE appli(argc,argv);
  appli.run();
}
